package com.xbts.system.domain;


import java.math.BigDecimal;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.Data;
import com.xbts.common.annotation.Excel;
import com.xbts.common.utils.StringUtils;
import com.xbts.common.core.domain.BaseEntity;

/**
 * 对公账户充值记录对象 cn_recharge_to_corporate_account_log
 *
 * @author xbts
 * @date 2023-11-29
 */
@Data
@ApiModel("对公账户充值记录对象")
@TableName("cn_recharge_to_corporate_account_log")
public class CnRechargeToCorporateAccountLog extends BaseEntity {

    private static final long serialVersionUID=1L;

    /** ID */
    @TableId
    private String id;

    /** 充值金额 */
    @Excel(name = "充值金额")
    @ApiModelProperty("充值金额")
    @NotNull(message = "充值金额不能为空")
    private BigDecimal amount;

    /** 用户Id */
    @Excel(name = "用户Id")
    @ApiModelProperty("用户Id")
    private String userId;

    /** 用户昵称 */
    @Excel(name = "用户昵称")
    @ApiModelProperty("用户昵称")
    private String nickName;

    /** 付款凭证 */
    @Excel(name = "付款凭证")
    @ApiModelProperty("付款凭证")
    @NotEmpty(message = "付款凭证不能为空")
    private String paymentVoucher;

    /** 状态（1待审核，2审核通过，3审核拒绝） */
    @Excel(name = "状态", readConverterExp = "1=待审核，2=审核通过，3=审核拒绝")
    @ApiModelProperty("状态")
    private String status;

    /** 备注 */
    @Excel(name = "备注")
    @ApiModelProperty("备注")
    private String remark;

    /** 审核人员昵称 */
    @Excel(name = "审核人员昵称")
    @ApiModelProperty("审核人员昵称")
    private String reviewer;

    public<T> QueryWrapper<T> queryWrapper(){
        QueryWrapper<T> queryWrapper=new QueryWrapper<>();
        queryWrapper.like(StringUtils.isNotEmpty(userId),"user_id",userId);
        queryWrapper.like(StringUtils.isNotEmpty(nickName),"nick_name",nickName);
        queryWrapper.like(StringUtils.isNotEmpty(paymentVoucher),"payment_voucher",paymentVoucher);
        queryWrapper.like(StringUtils.isNotEmpty(status),"status",status);
        queryWrapper.like(StringUtils.isNotEmpty(remark),"remark",remark);
        queryWrapper.like(StringUtils.isNotEmpty(reviewer),"reviewer",reviewer);
        queryWrapper.orderByDesc("create_time");
        return queryWrapper;
    }
}